How to use the `itemDoubleClicked(QTreeWidgetItem*,int)` signal in qtHaskell

Posted by nano on Stack Overflow See other posts from Stack Overflow or by nano
Published on 2010-06-07T16:49:59Z Indexed on 2010/06/07 16:52 UTC
Read the original article Hit count: 277

Filed under:
|
|

I want to use the itemDoubleClicked(QTreeWidgetItem*,int) signal in a Haskell program I'm writing where I am using qtHaskell for the GUI. To connect a function I have at other places done the following:

dummyWidget <- myQWidget
connectSlot object signal dummyWidget "customSlot()" $ f

Where object is some QWidget and signal is a string giving the signal, e.g. "triggered()", and f is the function I want to be called when the signaled is send. The definition of connectSlot in the API is:

class Qcs x where
  connectSlot :: QObject a -> String -> QObject b -> String -> x -> IO ()

where the instances ofQcs are:

Qcs ()  
Qcs (QObject c -> String -> IO ())  
Qcs (QObject c -> Object d -> IO ())  
Qcs (QObject c -> Bool -> IO ())  
Qcs (QObject c -> Int -> IO ())  
Qcs (QObject c -> IO ())  
Qcs (QObject c -> OpenGLVersionFlag -> IO ())

The first Arguments passed is supposed to be the QObject of which I'm using a signal. As you can see, there is no instance where f, the function to connect to the signal, can have two further arguments to recieve the QWidget and the integer send by the signal. Is there a way to nevertheless connect that signal to a custom function?

© Stack Overflow or respective owner

Related posts about qt

Related posts about haskell